package com.example.browserview;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebSettings.RenderPriority;
import android.webkit.WebView;

public class BrowserView extends Activity {
	protected static final String TAG = "BrowserView";
	private WebView webView;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		webView = (WebView) findViewById(R.id.web_view);
		openBrowser();

	}

	/** Open a browser on the URL specified in the text box */
	private void openBrowser() {
		webView.getSettings().setBuiltInZoomControls(false);
		webView.getSettings().setJavaScriptEnabled(true);
		webView.getSettings().setRenderPriority(RenderPriority.HIGH);

		// change the IP with the one of the machine where the test service is running.
		// The IP should not be 127.0.0.1 as the android device (real or emulated) 
		// has its own IP address.
		String url = "file:///android_asset/Gwt_dynScript_test.html?service=10.198.74.198";
		Log.d(TAG, "Loading page : " + url);
		webView.loadUrl(url);
		
	}

}